Fixed problem with uints resulting in huge child allocations.
authorOwen Taylor <otaylor@redhat.com>
Mon, 1 Feb 1999 21:55:49 +0000 (21:55 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 1 Feb 1999 21:55:49 +0000 (21:55 +0000)
Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>

* gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate):
 Fixed problem with uints resulting in huge child
 allocations.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkoptionmenu.c

index 27fad15951797526c28c7b75873cb37161ae802c..4a070c104e44fb54565f24b27820d83bb6b4546c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,17 @@
+Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
+        Fixed problem with uints resulting in huge child
+        allocations.
+
 Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c (gtk_label_expose): Cast uints
-         to ints in geometry calculations. This should
-         prevent FP exceptions on FreeBSD when quantities
-         become negative. [ Actually, this is probably
-         a workaround with a gcc bug with handling of
-         bitfields, according to Ben Jackson <ben@ben.com> ]
+        to ints in geometry calculations. This should
+        prevent FP exceptions on FreeBSD when quantities
+        become negative. [ Actually, this is probably
+        a workaround with a gcc bug with handling of
+        bitfields, according to Ben Jackson <ben@ben.com> ]
 
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
index 27fad15951797526c28c7b75873cb37161ae802c..4a070c104e44fb54565f24b27820d83bb6b4546c 100644 (file)
@@ -1,11 +1,17 @@
+Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
+        Fixed problem with uints resulting in huge child
+        allocations.
+
 Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c (gtk_label_expose): Cast uints
-         to ints in geometry calculations. This should
-         prevent FP exceptions on FreeBSD when quantities
-         become negative. [ Actually, this is probably
-         a workaround with a gcc bug with handling of
-         bitfields, according to Ben Jackson <ben@ben.com> ]
+        to ints in geometry calculations. This should
+        prevent FP exceptions on FreeBSD when quantities
+        become negative. [ Actually, this is probably
+        a workaround with a gcc bug with handling of
+        bitfields, according to Ben Jackson <ben@ben.com> ]
 
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
index 27fad15951797526c28c7b75873cb37161ae802c..4a070c104e44fb54565f24b27820d83bb6b4546c 100644 (file)
@@ -1,11 +1,17 @@
+Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
+        Fixed problem with uints resulting in huge child
+        allocations.
+
 Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c (gtk_label_expose): Cast uints
-         to ints in geometry calculations. This should
-         prevent FP exceptions on FreeBSD when quantities
-         become negative. [ Actually, this is probably
-         a workaround with a gcc bug with handling of
-         bitfields, according to Ben Jackson <ben@ben.com> ]
+        to ints in geometry calculations. This should
+        prevent FP exceptions on FreeBSD when quantities
+        become negative. [ Actually, this is probably
+        a workaround with a gcc bug with handling of
+        bitfields, according to Ben Jackson <ben@ben.com> ]
 
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
index 27fad15951797526c28c7b75873cb37161ae802c..4a070c104e44fb54565f24b27820d83bb6b4546c 100644 (file)
@@ -1,11 +1,17 @@
+Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
+        Fixed problem with uints resulting in huge child
+        allocations.
+
 Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c (gtk_label_expose): Cast uints
-         to ints in geometry calculations. This should
-         prevent FP exceptions on FreeBSD when quantities
-         become negative. [ Actually, this is probably
-         a workaround with a gcc bug with handling of
-         bitfields, according to Ben Jackson <ben@ben.com> ]
+        to ints in geometry calculations. This should
+        prevent FP exceptions on FreeBSD when quantities
+        become negative. [ Actually, this is probably
+        a workaround with a gcc bug with handling of
+        bitfields, according to Ben Jackson <ben@ben.com> ]
 
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
index 27fad15951797526c28c7b75873cb37161ae802c..4a070c104e44fb54565f24b27820d83bb6b4546c 100644 (file)
@@ -1,11 +1,17 @@
+Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
+        Fixed problem with uints resulting in huge child
+        allocations.
+
 Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c (gtk_label_expose): Cast uints
-         to ints in geometry calculations. This should
-         prevent FP exceptions on FreeBSD when quantities
-         become negative. [ Actually, this is probably
-         a workaround with a gcc bug with handling of
-         bitfields, according to Ben Jackson <ben@ben.com> ]
+        to ints in geometry calculations. This should
+        prevent FP exceptions on FreeBSD when quantities
+        become negative. [ Actually, this is probably
+        a workaround with a gcc bug with handling of
+        bitfields, according to Ben Jackson <ben@ben.com> ]
 
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
index 27fad15951797526c28c7b75873cb37161ae802c..4a070c104e44fb54565f24b27820d83bb6b4546c 100644 (file)
@@ -1,11 +1,17 @@
+Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
+        Fixed problem with uints resulting in huge child
+        allocations.
+
 Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c (gtk_label_expose): Cast uints
-         to ints in geometry calculations. This should
-         prevent FP exceptions on FreeBSD when quantities
-         become negative. [ Actually, this is probably
-         a workaround with a gcc bug with handling of
-         bitfields, according to Ben Jackson <ben@ben.com> ]
+        to ints in geometry calculations. This should
+        prevent FP exceptions on FreeBSD when quantities
+        become negative. [ Actually, this is probably
+        a workaround with a gcc bug with handling of
+        bitfields, according to Ben Jackson <ben@ben.com> ]
 
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
index 27fad15951797526c28c7b75873cb37161ae802c..4a070c104e44fb54565f24b27820d83bb6b4546c 100644 (file)
@@ -1,11 +1,17 @@
+Mon Feb  1 15:14:56 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_size_allocate): 
+        Fixed problem with uints resulting in huge child
+        allocations.
+
 Mon Feb  1 14:54:28 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c (gtk_label_expose): Cast uints
-         to ints in geometry calculations. This should
-         prevent FP exceptions on FreeBSD when quantities
-         become negative. [ Actually, this is probably
-         a workaround with a gcc bug with handling of
-         bitfields, according to Ben Jackson <ben@ben.com> ]
+        to ints in geometry calculations. This should
+        prevent FP exceptions on FreeBSD when quantities
+        become negative. [ Actually, this is probably
+        a workaround with a gcc bug with handling of
+        bitfields, according to Ben Jackson <ben@ben.com> ]
 
 Mon Feb  1 13:35:14 GMT 1999 Tony Gale  <gale@gtk.org>
 
index bf42d863e8d27c959783c53029a8747386ef5b5f..c888625fca9252286ff5ed52e1c7af10d50ff019 100644 (file)
@@ -307,11 +307,11 @@ gtk_option_menu_size_allocate (GtkWidget     *widget,
                            GTK_WIDGET (widget)->style->klass->xthickness) + 1;
       child_allocation.y = (GTK_CONTAINER (widget)->border_width +
                            GTK_WIDGET (widget)->style->klass->ythickness) + 1;
-      child_allocation.width = (allocation->width - child_allocation.x * 2 -
-                               OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 5 -
-                               CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING) - 2;
-      child_allocation.height = (allocation->height - child_allocation.y * 2 -
-                                CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING) - 2;
+      child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2 -
+                                   OPTION_INDICATOR_WIDTH - OPTION_INDICATOR_SPACING * 5 -
+                                   CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING - 2);
+      child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2 -
+                                    CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING - 2);
       child_allocation.x += CHILD_LEFT_SPACING;
       child_allocation.y += CHILD_RIGHT_SPACING;